package example;
import java.util.*;
public class count {
	
	public static int count_array(int [] x)
	{
		int max = -9999;
		int length = x.length;
		for(int i =0; i< length; i++)
		{
			int a = x[i]; 
			for(int j = i+1; j<= length-1; j++)
			{
				if(j == length)
				{
					a = x[i];
				}
				else
				{
					a = a + x[j];
				}
				if(a > max)
				{
					max = a;
				}
			}
		}
		return max;
	}
}
